<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>Subst Iterators (GNU Compiler Collection (GCC) Internals)</title>

<meta name="description" content="Subst Iterators (GNU Compiler Collection (GCC) Internals)">
<meta name="keywords" content="Subst Iterators (GNU Compiler Collection (GCC) Internals)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Option-Index.html" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Iterators.html" rel="up" title="Iterators">
<link href="Parameterized-Names.html" rel="next" title="Parameterized Names">
<link href="Int-Iterators.html" rel="prev" title="Int Iterators">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
div.example {margin-left: 3.2em}
span:hover a.copiable-link {visibility: visible}
-->
</style>


</head>

<body lang="en">
<div class="subsection-level-extent" id="Subst-Iterators">
<div class="nav-panel">
<p>
Next: <a href="Parameterized-Names.html" accesskey="n" rel="next">Parameterized Names</a>, Previous: <a href="Int-Iterators.html" accesskey="p" rel="prev">Int Iterators</a>, Up: <a href="Iterators.html" accesskey="u" rel="up">Iterators</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsection" id="Subst-Iterators-1"><span>17.23.4 Subst Iterators<a class="copiable-link" href="#Subst-Iterators-1"> &para;</a></span></h4>
<a class="index-entry-id" id="index-subst-iterators-in-_002emd-files"></a>
<a class="index-entry-id" id="index-define_005fsubst-5"></a>
<a class="index-entry-id" id="index-define_005fsubst_005fattr"></a>

<p>Subst iterators are special type of iterators with the following
restrictions: they could not be declared explicitly, they always have
only two values, and they do not have explicit dedicated name.
Subst-iterators are triggered only when corresponding subst-attribute is
used in RTL-pattern.
</p>
<p>Subst iterators transform templates in the following way: the templates
are duplicated, the subst-attributes in these templates are replaced
with the corresponding values, and a new attribute is implicitly added
to the given <code class="code">define_insn</code>/<code class="code">define_expand</code>.  The name of the
added attribute matches the name of <code class="code">define_subst</code>.  Such
attributes are declared implicitly, and it is not allowed to have a
<code class="code">define_attr</code> named as a <code class="code">define_subst</code>.
</p>
<p>Each subst iterator is linked to a <code class="code">define_subst</code>.  It is declared
implicitly by the first appearance of the corresponding
<code class="code">define_subst_attr</code>, and it is not allowed to define it explicitly.
</p>
<p>Declarations of subst-attributes have the following syntax:
</p>
<a class="index-entry-id" id="index-define_005fsubst_005fattr-1"></a>
<div class="example smallexample">
<pre class="example-preformatted">(define_subst_attr &quot;<var class="var">name</var>&quot;
  &quot;<var class="var">subst-name</var>&quot;
  &quot;<var class="var">no-subst-value</var>&quot;
  &quot;<var class="var">subst-applied-value</var>&quot;)
</pre></div>

<p><var class="var">name</var> is a string with which the given subst-attribute could be
referred to.
</p>
<p><var class="var">subst-name</var> shows which <code class="code">define_subst</code> should be applied to an
RTL-template if the given subst-attribute is present in the
RTL-template.
</p>
<p><var class="var">no-subst-value</var> is a value with which subst-attribute would be
replaced in the first copy of the original RTL-template.
</p>
<p><var class="var">subst-applied-value</var> is a value with which subst-attribute would be
replaced in the second copy of the original RTL-template.
</p>
</div>



</body>
</html>
